package com.minimalist.common.feign.client.lindi;

import com.minimalist.common.config.mybatis.bo.PageResp;
import com.minimalist.common.entity.lindi.vo.contracttemplatefield.LindiContractTemplateFieldQueryVO;
import com.minimalist.common.entity.lindi.vo.contracttemplatefield.LindiContractTemplateFieldVO;
import com.minimalist.common.feign.config.FeignConfig;
import com.minimalist.common.feign.fallback.lindi.LindiContractTemplateFieldFeignClientFallbackFactory;
import com.minimalist.common.response.R;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import jakarta.validation.constraints.NotNull;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 林地指标平台_合同模板字段 Feign 客户端
 *
 * @author 11987
 */
@FeignClient(name = "minimalist-lindi"
        , contextId = "lindiContractTemplateFieldFeignClient"
        , path = "/minimalist/lindi/contractTemplateField"
        , configuration = FeignConfig.class
        , fallbackFactory = LindiContractTemplateFieldFeignClientFallbackFactory.class)
public interface LindiContractTemplateFieldFeignClient {
    /**
     * 添加合同模板字段
     *
     * @param contractTemplateFieldVO 合同模板字段信息
     * @return 成功或失败
     */
    @PostMapping("/addContractTemplateField")
    @Operation(summary = "添加合同模板字段")
    R<?> addContractTemplateField(
            @RequestBody @Validated(Add.class)
            LindiContractTemplateFieldVO contractTemplateFieldVO);

    /**
     * 删除合同模板字段 -> 根据合同模板字段ID删除
     *
     * @param contractTemplateFieldId 合同模板字段ID
     * @return 成功或失败
     */
    @DeleteMapping("/deleteContractTemplateFieldByContractTemplateFieldId")
    @Operation(summary = "删除合同模板字段 -> 根据合同模板字段ID删除")
    R<?> deleteContractTemplateFieldByContractTemplateFieldId(
            @RequestParam("contractTemplateFieldId")
            @NotNull(message = "合同模板字段ID不能为空")
            @Parameter(name = "contractTemplateFieldId", required = true, description = "合同模板字段ID")
            Long contractTemplateFieldId);

    /**
     * 修改合同模板字段
     *
     * @param contractTemplateFieldVO 合同模板字段信息
     * @return 成功或失败
     */
    @PutMapping("/updateContractTemplateFieldByContractTemplateFieldId")
    @Operation(summary = "修改合同模板字段")
    R<?> updateContractTemplateFieldByContractTemplateFieldId(
            @RequestBody @Validated(Update.class)
            LindiContractTemplateFieldVO contractTemplateFieldVO);

    /**
     * 查询合同模板字段列表(分页)
     *
     * @param queryVO 查询条件
     * @return 合同模板字段列表
     */
    @GetMapping("/getPageContractTemplateFieldList")
    @Operation(summary = "查询合同模板字段列表(分页)")
    R<PageResp<LindiContractTemplateFieldVO>> getPageContractTemplateFieldList(
            @RequestBody LindiContractTemplateFieldQueryVO queryVO);

    /**
     * 根据合同模板字段ID查询合同模板字段
     *
     * @param contractTemplateFieldId 合同模板字段ID
     * @return 合同模板字段
     */
    @GetMapping("/getContractTemplateFieldByContractTemplateFieldId/{contractTemplateFieldId}")
    @Operation(summary = "根据合同模板字段ID查询合同模板字段")
    R<LindiContractTemplateFieldVO> getContractTemplateFieldByContractTemplateFieldId(
            @PathVariable(value = "contractTemplateFieldId")
            @NotNull(message = "合同模板字段ID不能为空")
            @Parameter(name = "contractTemplateFieldId", description = "合同模板字段ID", required = true)
            Long contractTemplateFieldId);
}